package org.jeecg.modules.dmyweb.base.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.dmyweb.base.service.IBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Api(tags="dmyweb-base")
@RestController
@RequestMapping("/dmyweb/base")
@Slf4j
public class BaseController {

    @Autowired
    private IBaseService baseService;

    @AutoLog(value = "base-自定义sql")
    @ApiOperation(value="base-自定义sql", notes="base-自定义sql")
    @PostMapping(value = "/getSqlQuery")
    public Result<?> getSqlQuery() {
        String sql = "select * from demo";
        List<Map<String,Object>> listMap = baseService.getSqlQuery(sql);
        return Result.OK(listMap);
    }



}
